//
//  TacticViewController.m
//  CooperLinker
//
//  Created by 洪雯 on 16/4/17.
//  Copyright © 2016年 洪雯. All rights reserved.
//

#import "TacticViewController.h"
#import "RPSlidingMenuCell.h"
#import "RPSlidingMenuLayout.h"
#import "TravelNotesViewController.h"

#define SCREEN_WIDTH ([[UIScreen mainScreen] bounds].size.width)
#define SCREEN_HEIGHT ([[UIScreen mainScreen] bounds].size.height)
#define Demo7CellId @"demo6cellid"
@interface TacticViewController ()<UICollectionViewDataSource,UICollectionViewDelegate>
@property (nonatomic , strong) UICollectionView *collectionView;
@end

@implementation TacticViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    [self initView];
}
- (void)initView{
   //[super initView];
    
    RPSlidingMenuLayout *layout = [[RPSlidingMenuLayout alloc] initWithDelegate:nil];
    
    _collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0,0, SCREEN_WIDTH, SCREEN_HEIGHT) collectionViewLayout:layout];
    _collectionView.dataSource = self;
    _collectionView.delegate = self;
    [self.view addSubview:_collectionView];
    
    [_collectionView registerClass:[RPSlidingMenuCell class] forCellWithReuseIdentifier:Demo7CellId];
}


- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
    return 31;
}

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
    RPSlidingMenuCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:Demo7CellId forIndexPath:indexPath];
    cell.textLabel.text = [NSString stringWithFormat:@"风景%zi",indexPath.row];
    cell.detailTextLabel.text = [NSString stringWithFormat:@"风景简介风景简介风景简介%zi",indexPath.row];
    cell.backgroundImageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"shiyuanhui.jpg"]];
    
    return cell;
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
    TravelNotesViewController *traveVC = [[TravelNotesViewController alloc]init];
    [self.navigationController pushViewController:traveVC animated:YES];
}




@end
